/***************************************************************************
 *   Copyright (C) 2009 by Zheng Yonglei
 *   zhengyonglei@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef OPTIONS_H_
#define OPTIONS_H_

#include <QSettings>
#include <QVariant>
#include <QTimer>
#include <QFont>
#include <QDir>

#include "StaticModule.h"
#include "types.h"
//#include "config.h"

#define OPT StaticModule<Options>::getInstance()

class Options
{
public:
	Options();
	~Options();

	void readSettings();
	void writeSettings();

	//global
	bool isPaused;
	QString language;
	bool lockSwitchTask;

	//account
	QString lastAccount;
	bool hasLogined;

	bool autoSpeak;
	bool enableSpeak;
	bool lockSpeak;
	bool useQSound;
	QString playSoundCommand;
	QString speakLibPath;

	//QString SpellTestHintDict;

	//float grossPassRateStep;

	int quickSelectWordCount;
	int selectWordPolicy;
	int scanRangePolicy;

	//main window geometry
	Qt::WindowStates mainWindowStatus;
	int mainWindowHeight;
	int mainWindowWidth;
	int mainWindowX;
	int mainWindowY;

	//font size
	//int browseDisplayFontSize;
	//int reciteDisplayFontSize;
	QFont programFont;
	QFont wordBrowserFont;

	//browse task
	bool skipFinishedWords;

	//new refresh problem
	bool forceRefresh;
	int refreshInterval;
	QTimer* refreshTimer;

	//about test method
	bool useYesNoTestMethod;
	bool useMultiExpTestMethod;
	bool useMultiEngTestMethod;
	bool useSpellTestMethod;
	TestMethod curTestMethod;

	//yes/no method
	int firstGroupWaitSecMax;
	int secondGroupWaitSecMin;

	//word browser navigation list
	bool enableArticleNav;
	bool lockArticleNav;
	//bool showArticleNavList;
	//bool showThNavList;

	//word browser page navigation
	bool enableHistoryNav;
	bool lockHistoryNav;

	//bool enableSearch;
	//bool lockSearch;

	//associate memory
	bool enableAssociateMap;
	bool hasAssociateMap;

	//search
	bool enableWordBrowserSearch;
	bool lockWordBrowserSearch;

	//dictionary manager
	QString mainShadingColor;
	QString selectShadingColor;
	//bool ignorePhrase;
};

#endif /* OPTIONS_H_ */
